﻿using System;
using SilentWebsite.Model.Contracts;
using SilentWebsite.Model.Services;
using SilentWebsite.ViewModels.Helpers;
using SilentWebsite.Web;

namespace SilentWebsite.Model
{
    public class SilentEngine : IDisposable
    {
        private static readonly Lazy<SilentEngine> lazy = new Lazy<SilentEngine>();
        public static SilentEngine Instance 
        {
            get { return lazy.Value; }
        }

        public IAuthenticationService Authentication { get; set; }
        public IDataService Data { get; set; }
        public IAccountService Accounts { get; set; }
        public User CurrentUser { get; set; }

        public SilentEngine()
        {
            Authentication = new AuthenticationServiceClient();
            Data = new DataServiceClient();
            Accounts = new AccountServiceClient();

            NavigationService.Links.Add("FACEBOOK", "http://www.facebook.com/just.me.gaara");
            NavigationService.Links.Add("TWITTER", "http://www.twitter.com/JustMeGaaRa");
            NavigationService.Links.Add("YOUTUBE", "http://www.youtube.com/user/JustMeGaaRa");

            NavigationService.Pages.Add("START", "/Views/StartPage.xaml");
            NavigationService.Pages.Add("WHERE TO START", "/Views/WhereToStartPage.xaml");
            NavigationService.Pages.Add("PAGES", "/Views/PagesPage.xaml");
            NavigationService.Pages.Add("SETTINGS", "/Views/SettingsPage.xaml");
            NavigationService.Pages.Add("ABOUT", "/Views/AboutPage.xaml");
            NavigationService.Pages.Add("NEW PAGE", "/Views/NewPage.xaml");
            NavigationService.Pages.Add("DESIGN", "/Views/DesignPage.xaml");
            NavigationService.Pages.Add("PROFILE", "/Views/ProfilePage.xaml");
        }

        #region IDisposible Implementation

        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                
            }
        }
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
        ~SilentEngine()
        {
            Dispose(false);
        }

        #endregion
    }
}
